﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />
<!DOCTYPE html>
<html lang="zh-CN">
<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body>

	<%@ include file="/WEB-INF/include/header.jsp"%>

	<%@ include file="/WEB-INF/include/menu.jsp"%>

	<div class="container main-content">

		<div class="panel panel-default x-panel x-panel-layout">

			<div class="panel-heading">
				<ol class="breadcrumb">
					<li><a href="${ctx.host}/ecommerce">渠道管理</a></li>
					<li class="active">渠道分类</li>
				</ol>
			</div>

			<div class="panel-body">

				<div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
					<%@ include file="/WEB-INF/include/submenu.jsp"%>
				</div>

				<div class="col-xs-10 x-panel-layout-right">

					<div class="x-breadcrumb-wrapper">
						<div class="x-breadcrumb clearfix">
							<h2>
								<i class="glyphicon glyphicon-fire" title="产品分类"></i>&nbsp;&nbsp;<span>渠道分类&nbsp;-&nbsp;分类列表</span>
							</h2>
							
						</div>
						<div class="row">
							<div class="col-xs-4" style="padding-left: 0px; padding-right: 0px;">
								<div class="col-xs-12 product-category" style="min-height: 250px;">
									<div class="panel panel-default denver-panel denver-panel-layout">
										<div class="panel-heading">
											<span>固定大类</span>
										</div>
										<ul class="list-group">
											<c:forEach var="parentMapItem" items="${parentMap}">
												<c:if test="${!parentMapItem.value.coubldEdit()}">
												  <li class="list-group-item"><span>${parentMapItem.value.name}</span></li>
												</c:if>
											</c:forEach>
										</ul>

									</div>
								</div>
							</div>
							<c:forEach var="parentMapItem" items="${parentMap}">
								<c:if test="${parentMapItem.value.coubldEdit()}">
									<div class="col-xs-4" style="padding-left: 0px; padding-right: 0px;">
										<div class="col-xs-12 product-category" style="min-height: 250px;">
											<div class="panel panel-default denver-panel denver-panel-layout">
												<div class="panel-heading">
													<span>${parentMapItem.value.name}</span>
												</div>
												<ul class="list-group">
													<c:forEach var="children" items="${childrensMap[parentMapItem.key]}">
														<li class="list-group-item"><span>${children.name}</span> <%-- <a href="${ctx.host}/source-channels/${category.id}/delete" data-target="#delete" data-toggle="modal" class="pull-right"><i class="glyphicon glyphicon-remove"></i></a> --%> <a href="${ctx.host}/source-channels/${children.id}/edit" data-target="#edit" data-toggle="modal" ：class="pull-right" style="right: 30px;"><i class="glyphicon glyphicon-edit"></i></a></li>
													</c:forEach>
												</ul>
												<c:if test="${parentMapItem.value.coubldEdit()}">
													<div class="panel-footer text-center">
														<a href="${ctx.host}/source-channels/create?parent=${parentMapItem.key}" class="hover-no-text-decoration" data-target="#create" data-toggle="modal"><i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加新类别</a>
													</div>
												</c:if>
											</div>
										</div>
									</div>
								</c:if>
							</c:forEach>

						</div>

					</div>
				</div>
			</div>
		</div>

		<%@ include file="/WEB-INF/include/script.jsp"%>
		<d:resource root="${ctx.resource}/build" type="script" src="js/page/common-page.js">
			<script type="text/javascript">
      require(['page/common-page'],function(page){
          page.init();
      })
    </script>
		</d:resource>
</body>

</html>
